package com.ylyr.routerfunction.utils;

import com.ylyr.routerfunction.exceptions.CheckException;

import java.util.stream.Stream;

/**
 * @Explain:
 * @Author: 30374
 * @Date: 2021/4/22
 */
public class CheckUtils {
    public static final String[] INVENT_VALUE = {"admin", "kj"};

    public static void CheckException(String value) {
        Stream.of(INVENT_VALUE)
                .filter(name -> name.equalsIgnoreCase(value))
                .findAny()
                .ifPresent(key -> {
                    throw new CheckException("name", key);
                });
    }
}
